package com.local.ApacheCommonsTools.BeanUtils.CloneBeanToBean;

import java.lang.reflect.InvocationTargetException;

import org.apache.commons.beanutils.BeanUtils;

import com.local.ApacheCommonsTools.BeanUtils.CopyMapBean.PersonBean;

public class CloneBeanToBean {



	public static void main(String[] args) {
          PersonBean per1 = new PersonBean();
          per1.setAge("15");
          per1.setName("FateSaki");
          per1.setSequence(124l);
          PersonBean per2 = null;
          try {
			per2 = (PersonBean) BeanUtils.cloneBean(per1);
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InstantiationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NoSuchMethodException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
          System.out.println(per2.getName());
          System.out.println(per2.getSex());//无对应值为null
          System.out.println(per2.getAge());
          System.out.println(per2.getSequence());
	}
}
